package com.cskaoyan.mapper;

import com.cskaoyan.bean.po.MarketRole;
import com.cskaoyan.bean.po.MarketRoleExample;
import com.cskaoyan.bean.vo.systemVo.AssignedPermissions;
import com.cskaoyan.bean.vo.systemVo.TypePort;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public interface MarketRoleMapper {
    long countByExample(MarketRoleExample example);

    int deleteByExample(MarketRoleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketRole record);

    int insertSelective(MarketRole record);

    List<MarketRole> selectByExample(MarketRoleExample example);

    MarketRole selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketRole record, @Param("example") MarketRoleExample example);

    int updateByExample(@Param("record") MarketRole record, @Param("example") MarketRoleExample example);

    int updateByPrimaryKeySelective(MarketRole record);

    int updateByPrimaryKey(MarketRole record);

    List<MarketRole> selectRole(String name);

    int insertRole(@Param("marketRole") MarketRole marketRole);


    ArrayList<String> selectPermissions(Integer roleId);

    ArrayList<String> selectType();

    ArrayList<String> selectTypeChildren(String type);

    ArrayList<TypePort> selectTypePort(String typesChild);

    ArrayList<String> selectTypePortAll();

    int deletePermissionsByRoleId(Integer roleId);

    int insertPermissions(@Param("roleId") Integer roleId, @Param("permission") String permission);

    String[] selectByRoleIds(@Param("roleIds") Integer[] roleIds);

}